package com.teaphy.coroutinecrawler.flow.operators.terminal

import kotlinx.coroutines.*
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.flow.single

fun main() = runBlocking{
    val value = flow {
        delay(1000)
        emit(1)
    }.onStart {
        println("flow start")
    }.single()

    println("value :$value")
}

